package web.Roles;

import services.RolesServiceAll;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/DelRolesInfo")
public class DelRolesInfo extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.setContentType("application/json");
        String rname = req.getParameter("Rname");
        RolesServiceAll rolesServiceAll = new RolesServiceAll();
        int dele = rolesServiceAll.dele(rname);
        if(dele>0){
            resp.getWriter().println("删除成功");
        }else{
            resp.getWriter().println("删除失败");
        }
    }
}
